package com.hbt.springbootquick.dao;

import com.hbt.springbootquick.entity.HyUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface HyUserMapper {
    @Select("select *from hyusers order by grade desc limit #{count}")
//    @Select("select *from hyusers where userLevel != #{count}")
    public List<HyUser> getHyUserByCount(int count);

    @Select("select *from hyusers where userUnionId = #{id} order by grade desc limit 1")
    public HyUser getHyUserById(String id);

    public void insertHyUser(HyUser hyUser);

    @Delete("delete from hyusers where userLevel != #{level}")
    public void deleteUsersByCondition(int level);
}
